Integrand size = 21, antiderivative size = 55 \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b} d} \]
[Out]
Time = 0.04 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3265, 400, 212, 214} \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\frac {\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{a d \sqrt {a+b}}-\frac {\text {arctanh}(\cos (c+d x))}{a d} \]
[In]
[Out]
Rule 212
Rule 214
Rule 400
Rule 3265
Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a d}+\frac {b \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{a d} \\ & = -\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b} d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.54 (sec) , antiderivative size = 143, normalized size of antiderivative = 2.60 \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b}-i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{\sqrt {-a-b}}+\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b}+i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{\sqrt {-a-b}}+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a d} \]
[In]
[Out]
Time = 0.63 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.13
method | result | size |
derivativedivides | \(\frac {\frac {b \,\operatorname {arctanh}\left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{a \sqrt {\left (a +b \right ) b}}-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a}}{d}\) | \(62\) |
default | \(\frac {\frac {b \,\operatorname {arctanh}\left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{a \sqrt {\left (a +b \right ) b}}-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a}}{d}\) | \(62\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}+\frac {i \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right )}{2 \left (a +b \right ) d a}-\frac {i \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}\, {\mathrm e}^{i \left (d x +c \right )}}{b}+1\right )}{2 \left (a +b \right ) d a}\) | \(155\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.93 \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\left [\frac {\sqrt {\frac {b}{a + b}} \log \left (\frac {b \cos \left (d x + c\right )^{2} + 2 \, {\left (a + b\right )} \sqrt {\frac {b}{a + b}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) - \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, a d}, -\frac {2 \, \sqrt {-\frac {b}{a + b}} \arctan \left (\sqrt {-\frac {b}{a + b}} \cos \left (d x + c\right )\right ) + \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, a d}\right ] \]
[In]
[Out]
\[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=\int \frac {\csc {\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.41 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.51 \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\frac {b \log \left (\frac {b \cos \left (d x + c\right ) - \sqrt {{\left (a + b\right )} b}}{b \cos \left (d x + c\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} a} + \frac {\log \left (\cos \left (d x + c\right ) + 1\right )}{a} - \frac {\log \left (\cos \left (d x + c\right ) - 1\right )}{a}}{2 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 100 vs. \(2 (47) = 94\).
Time = 0.40 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.82 \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\frac {2 \, b \arctan \left (\frac {b \cos \left (d x + c\right ) + a + b}{\sqrt {-a b - b^{2}} \cos \left (d x + c\right ) + \sqrt {-a b - b^{2}}}\right )}{\sqrt {-a b - b^{2}} a} - \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a}}{2 \, d} \]
[In]
[Out]
Time = 14.66 (sec) , antiderivative size = 457, normalized size of antiderivative = 8.31 \[ \int \frac {\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx=-\frac {\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )}{a\,d}-\frac {\mathrm {atan}\left (\frac {\frac {\left (2\,b^3\,\cos \left (c+d\,x\right )+\frac {\left (2\,a^2\,b^2-\frac {\cos \left (c+d\,x\right )\,\left (8\,a^3\,b^2+16\,a^2\,b^3\right )\,\sqrt {b\,\left (a+b\right )}}{4\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}}{2\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}\,1{}\mathrm {i}}{a^2+b\,a}+\frac {\left (2\,b^3\,\cos \left (c+d\,x\right )-\frac {\left (2\,a^2\,b^2+\frac {\cos \left (c+d\,x\right )\,\left (8\,a^3\,b^2+16\,a^2\,b^3\right )\,\sqrt {b\,\left (a+b\right )}}{4\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}}{2\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}\,1{}\mathrm {i}}{a^2+b\,a}}{\frac {\left (2\,b^3\,\cos \left (c+d\,x\right )+\frac {\left (2\,a^2\,b^2-\frac {\cos \left (c+d\,x\right )\,\left (8\,a^3\,b^2+16\,a^2\,b^3\right )\,\sqrt {b\,\left (a+b\right )}}{4\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}}{2\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}}{a^2+b\,a}-\frac {\left (2\,b^3\,\cos \left (c+d\,x\right )-\frac {\left (2\,a^2\,b^2+\frac {\cos \left (c+d\,x\right )\,\left (8\,a^3\,b^2+16\,a^2\,b^3\right )\,\sqrt {b\,\left (a+b\right )}}{4\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}}{2\,\left (a^2+b\,a\right )}\right )\,\sqrt {b\,\left (a+b\right )}}{a^2+b\,a}}\right )\,\sqrt {b\,\left (a+b\right )}\,1{}\mathrm {i}}{d\,\left (a^2+b\,a\right )} \]
[In]
[Out]